package com.moli.iov.base.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.moli.iov.base.model.po.VehicleFenceBinding;
import java.util.List;

/**
 * The type Vehicle fence binding param.
 *
 * @author wanghualin
 * @date 2019-09-21 11:03:58
 */
public class VehicleFenceBindingParam {

  private QueryWrapper<VehicleFenceBinding> queryWrapper;

  public VehicleFenceBindingParam() {
    queryWrapper = new QueryWrapper<>();
    queryWrapper.eq("is_delete", 0);
  }

  public QueryWrapper<VehicleFenceBinding> get() {
    return queryWrapper;
  }

  public VehicleFenceBindingParam queryEqFenceId(Long fenceId) {
    if (fenceId!=null) {
      queryWrapper.eq("fence_id", fenceId);
    }
    return this;
  }

  public VehicleFenceBindingParam queryInVin(List<String> vin) {
    if (vin != null && !vin.isEmpty()) {
      queryWrapper.in("vin", vin);
    }
    return this;
  }
  public VehicleFenceBindingParam queryEqVin(String vin) {
    if (vin != null && !vin.isEmpty()) {
      queryWrapper.eq("vin", vin);
    }
    return this;
  }
  public VehicleFenceBindingParam queryEqCompanyId(Long companyId) {
    if (companyId != null) {
      queryWrapper.eq("company_id", companyId);
    }
    return this;
  }
  /**
   * 围栏报警类型 (0 进围栏报警，1，出围栏报警)
   */
  public VehicleFenceBindingParam queryEqAlarmType(Integer alarmType) {

    if (alarmType != null) {
      queryWrapper.eq("alarm_type", "");
    }
    return this;
  }
}
